<template>
  <div>
    <b-modal v-model="showModal" centered>
      <template v-slot:modal-header>
        <div class="modalTop">
          <i class="ri-close-circle-line"></i>
          <div>ERROR o.spiderflow.core.executor.shape.VariableExecutor</div>
        </div>
        <div class="modalClose pointer" @click="showModal = false">
          关闭<i class="ri-close-line"></i>
        </div>
      </template>
      <div class="errorInfo">
        <div class="infoTitle">日志摘要</div>
        <div class="infoContent">
          <div class="infoContent-top">
            <span>2022-01-25 01:00:42.898</span>
            <span>网页解析</span>
            <span>测试环境</span>
            <span>192.168.71.32</span>
            <span>招标信源</span>
          </div>
          <div class="infoContent-bottom">
            <span>跟踪ID: aa-bb-1643215821</span>
            <span style="margin-left: 60px;">应用ID: SSPIDER_04_2021_08_1057</span>
          </div>
        </div>
      </div>
      <div class="modalContent">
        <div class="errorContent">
          {{errorContent}}
        </div>
      </div>
      <template v-slot:modal-footer>
        <div style="height:1px;"></div>
      </template>
    </b-modal>
  </div>
</template>
<script>
export default {
  data () {
    return {
      showModal: false,
      errorContent: `
                设置变量contenthtml出错，异常信息：{}
        org.spiderflow.core.expression.ExpressionError$TemplateException: Error (1): Couldn't call method 'json' with arguments '[<!DOCTYPE 
        html>
            at org.spiderflow.core.expression.ExpressionError.error(ExpressionError.java:53)
                at org.spiderflow.core.expression.parsing.Ast$MethodCall.evaluate(Ast.java:1227)
                at org.spiderflow.core.expression.parsing.Ast$MemberAccess.evaluate(Ast.java:915)
                at org.spiderflow.core.expression.interpreter.AstInterpreter.interpretNodeList(AstInterpreter.java:46)
                at org.spiderflow.core.expression.interpreter.AstInterpreter.interpret(AstInterpreter.java:31)
                at org.spiderflow.core.expression.ExpressionTemplate.render(ExpressionTemplate.java:36)
                at org.spiderflow.core.expression.DefaultExpressionEngine.execute(DefaultExpressionEngine.java:48)
                at org.spiderflow.core.utils.ExpressionUtils.execute(ExpressionUtils.java:56)
                at org.spiderflow.core.executor.shape.VariableExecutor.execute(VariableExecutor.java:76)
                at org.spiderflow.core.Spider.lambda$executeNode$4(Spider.java:341)
                at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:55)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at org.spiderflow.core.Spider.executeNode(Spider.java:377)
                at org.spiderflow.core.Spider.executeNextNodes(Spider.java:227)
                at org.spiderflow.core.Spider.lambda$executeRoot$3(Spider.java:189)
                at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:55)
                at org.spiderflow.concurrent.SpiderFlowThreadPoolExecutor$SubThreadPoolExecutor.lambda$submitAsync$0(SpiderFlowThreadPoolExe
        cutor.java:152)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
        Caused by: java.lang.RuntimeException: Couldn't call method 'json' with arguments '[<!DOCTYPE html>
        <html lang="zh-cmn-Hans">
        <html lang="zh-cmn-Hans">
        <head>
      `,
    }
  },
  methods: {
    open(){
      this.showModal = true
    }
  }
}
</script>
<style lang="scss" scoped>
.modalTop{
  display: flex;
  max-width: 90%;
  i{
    color: #5664d2;
    font-size: 25px;
    vertical-align: sub;
  }
  div{
    margin-left: 10px;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
  }
}
.modalClose{
  margin: auto 0;
  color: #999999;
  font-size: 13px;
  i{
    vertical-align: bottom;
    font-size: 15px;
  }
}
.errorInfo{
  padding: 0 1rem;
  border-bottom: 12px solid #efefef;
  .infoTitle{
    font-size: 15px;
    font-weight: 600;
  }
  .infoContent{
    color: #999999;
      padding-bottom: 5px;
    .infoContent-top{
      display: flex;
      justify-content: space-between;
    }
    .infoContent-bottom{}
  }
}
.modalContent{
  max-height: 50vh;
  overflow: auto;
  padding: 10px 1rem;
  .errorContent{}
}
</style>
